package com.android.topview.watermelon.util

import android.content.Context
import android.widget.Toast

private lateinit var toast: Toast

fun Context.showToast(message: String) {
    try {
        toast.cancel()
    } catch (ignore: UninitializedPropertyAccessException) {
    } finally {
        toast = Toast.makeText(this, message, Toast.LENGTH_SHORT)
        toast.show()
    }
}